<template>
  <div class="main">
    <div class="ship childCenter">
      <img src="./image/ship.png" alt="" />
    </div>
    <div class="wave1"></div>
    <div class="wave2"></div>
    <div class="wave3"></div>
    <div class="yu"></div>

    <div class="massage"><i class="el-icon-loading"></i>加载中.....</div>
  </div>
</template>

<script>
export default {
  name: "Load",
  mounted() {
    setTimeout(() => {
      this.$router.push("/pageindex/goodsshow");
    }, 2000);
  },
};
</script>

<style lang="less" scoped>
/* 主体区域 */
.main {
  position: absolute;
  height: 100%;
  width: 100%;
  background: url(./image/bg.png) no-repeat;
  background-size: 100%;
}
/* 船 */
.ship {
  animation: ship 1s infinite alternate;
}
/* 文字 */
.massage {
  font-size: 18px;
  color: red;
  position: absolute;
  left: 50%;
  bottom: 5%;
  transform: translateX(-50%);
  z-index: 3;
}
/* 海浪 */
.wave1,
.wave2,
.wave3 {
  width: 100%;
  height: 100px;
  overflow: hidden;
  position: absolute;
  bottom: 0;
}
.wave1 {
  bottom: 0;
  z-index: 2;
  animation: wave 1s infinite alternate;
  background: url(./image/wave1.png);
}
.wave2 {
  bottom: 5%;
  z-index: 1;
  background: url(./image/wave2.png);
  animation: wave 2s infinite alternate ease-out;
}
.wave3 {
  bottom: 10%;
  background: url(./image/wave3.png);
  animation: wave 1s infinite alternate ease;
}

/* 鱼 */
.yu {
  width: 200px;
  height: 100px;
  position: absolute;
  bottom: 0%;
  left: 0%;
  background: url(./image/yu.png) no-repeat;
  animation: yu 3s infinite;
}

/* 海浪动画 */
@keyframes wave {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -60px 0;
  }
}
/* 船动画 */
@keyframes ship {
  from {
    transform: translate(-50%, -50%) rotate(5deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(-5deg);
  }
}

/* 鱼的动画 */
@keyframes yu {
  0% {
    bottom: 0%;
    left: 0%;
  }
  25% {
    bottom: 30%;
    left: 9%;
    transform: rotate(-40deg);
  }
  50% {
    bottom: 10px;
    left: 25%;
    transform: rotate(5deg);
  }
  100% {
    bottom: 5px;
    left: 80%;
  }
}
</style>
